package com.example.lt.service.video.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.lt.entity.video.VideoShare;
import com.example.lt.mapper.video.VideoShareMapper;
import com.example.lt.service.video.VideoShareService;
import org.springframework.stereotype.Service;

/**
 * @Author 小涛Tao
 * @Date: 2024/08/15/16:33
 * version 1.0 注释：
 **/
@Service
public class VideoShareServiceImpl extends ServiceImpl<VideoShareMapper, VideoShare> implements VideoShareService {

    /**
     * 分享视频记录
     * @param videoShare
     * @return
     */
    @Override
    public boolean share(VideoShare videoShare) {
        try {
            // 利用videoId和ip做为唯一索引,少一次查询
            this.save(videoShare);
        } catch (Exception e) {
            // 不用删除记录
            return false;
        }
        return true;
    }

}
